<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var food = prompt('请输入食物')

    switch(food) {
      case '香蕉':
        console.log('10块')
        break
      case '鸡蛋':
        console.log('5块')
        break
      case '面包':
        console.log('2块')
        break
      default:
        console.log('暂时不清楚')
    }
  </script>
</body>
</html>